﻿{include file="public/top"}
<div class="login-reg">
	<dl class="box">
		<dt>登录</dt>
		<form id="login_form" >
		<dd>
			<label>账号：</label>
			<input class="input" type="text" name="user" />
			<div class="clear"></div>
		</dd>
		<dd>
			<label>密码：</label>
			<input class="input" type="password" name="pass" />
			<div class="clear"></div>
		</dd>
		<dd>
			<label>验证码：</label>
			<input class="vcode"  type="text" name="_chkcode" id="_chkcode" />
			<img src="{:captcha_src()}" alt="captcha" onclick="this.src='{:captcha_src()}?seed='+Math.random()" height="24" id="captcha"  class="hand"/>
			<div class="clear"></div>
		</dd>
		<dd class="submit">
			<bottom class="button blue" onclick="click_login()">会员登录</bottom>
		</dd>
		</form>
	</dl>
	<dl class="box note">
		<dt>说明</dt>
		<dd>

		</dd>
		<dd>&nbsp;</dd>
	</dl>
	<div class="clear"></div>
</div>
{include file="public/bottom"}
</body>
</html>

<script type="text/javascript">
layui.use('layer', function(){
	var layer = layui.layer;
});              
function click_login()
{
	$.ajax({
		url:"{:url('index/common/login')}",
		data:$('#login_form').serialize(),
		type:'post',
		async: false,
		dataType:"json",
		success:function(res) {
			if(res.code == 1) {
				layer.alert(res.msg, function(index)
				{
					location.href = res.url;
				})
			} else {
				layer.msg(res.msg);
			}
		}
	})
}
</script>
